  ________       __          ________                          ___ ___                __    
 /  _____/______|__| _____   \______ \ _____ __  _  ______    /   |   \  ____   ____ |  | __
/   \  __\_  __ \  |/     \   |    |  \\__  \\ \/ \/ /    \  /    ~    \/  _ \ /  _ \|  |/ /
\    \_\  \  | \/  |  | |  \  |    `   \/ __ \\     /   |  \ \    Y    (  <_> |  <_> )    < 
 \______  /__|  |__|__|_|  / /_______  (____  /\/\_/|___|  /  \___|_  / \____/ \____/|__|_ \
        \/               \/          \/     \/           \/         \/                    \/
    
    Grim Dawn Hook (c) 2015 atom0s [atom0s@live.com]

----------------------------------------------------------------------------------------------------

    The following documentation covers additional functions exposed to addons.
    
----------------------------------------------------------------------------------------------------

    Bitpack Functions
    
            bitpack:unpackBitsBE(data, bit_offset, length) - Unpacks bits out of a value (big-endian).
                - data - The data to unpack the bits from.
                - bit_offset - The bit offset to unpack.
                - length - The length of the data to unpack.
            
            bitpack:unpackBitsBE(data, byte_offset, bit_offset, length) - Unpacks bits out of a value (big-endian).
                - data - The data to unpack the bits from.
                - byte_offset - The byte offset to unpack.
                - bit_offset - The bit offset to unpack.
                - length - The length of the data to unpack.
            
            bitpack:unpackBitsLE(data, bit_offset, length) - Unpacks bits out of a value (little-endian).
                - data - The data to unpack the bits from.
                - bit_offset - The bit offset to unpack.
                - length - The length of the data to unpack.
            
            bitpack:unpackBitsLE(data, byte_offset, bit_offset, length) - Unpacks bits out of a value (little-endian).
                - data - The data to unpack the bits from.
                - byte_offset - The byte offset to unpack.
                - bit_offset - The bit offset to unpack.
                - length - The length of the data to unpack.
    
----------------------------------------------------------------------------------------------------

    File Functions

            file:create_dir(dir) - Creates the given directory, and any missing sub-directories.
                - dir - The full path of to the directory to create.
                
            file:dir_exists(dir) - Checks if the given directory exists.
                - dir - The full path of to the directory to check for existence.
                
            file:file_exists(file) - Checks if the given file exists.
                - file - The full path of the file to check for existence.
                
            file:get_dir(dir) - Gets a list of files within the given directory.
                - dir - The full path of the directory to obtain.
                
            file:get_dirs(dir) - Gets a list of directories within the given directory.
                - dir - The full path of the directory to obtain.
            
----------------------------------------------------------------------------------------------------

    Misc Functions
    
            misc:open_url(url) - Opens the given website url.
                - url - The url to open.
    
----------------------------------------------------------------------------------------------------
    
    Sound Functions
    
            sound:playsound(sound_path) - Plays the given sound file.
                - sound_path - Full path to the sound file to play.
    
----------------------------------------------------------------------------------------------------

    Memory Functions
    
            mem:GetBaseAddress(modname) - Obtains the base address of the given module name.
                - modname - The module name to obtain the base address of.
            
            mem:AllocMemory(size) - Allocates a block of memory with the given size.
                - size - The size of memory to allocate.
                
            mem:DeallocMemory(addr, size) - Deallocates the given block of memory.
                - addr - The address of the memory that was allocated.
                - size - The size of memory that was allocated.
                
            mem:UnprotectMemory(addr, size) - Unprotects the region of memory starting at the address.
                - addr - The address to unprotect the memory of.
                - size - The size of memory to unprotect.
            
            mem:FindPattern(modname, bytetable, size, mask) - Finds a pattern of data within the given module.
                - modname - The module name to scan within.
                - bytetable - The table of bytes to compare against.
                - size - The size of the bytetable.
                - mask - The mask to use to scan against.
            
            mem:ReadUChar(addr) - Read an unsigned char.
                - addr - The address to read from.
            
            mem:ReadChar(addr) - Reads a signed char.
                - addr - The address to read from.
            
            mem:ReadUShort(addr) - Reads an unsigned short.
                - addr - The address to read from.
            
            mem:ReadShort(addr) - Reads a signed short.
                - addr - The address to read from.
            
            mem:ReadULong(addr) - Reads an unsigned long.
                - addr - The address to read from.
            
            mem:ReadLong(addr) - Reads a signed long.
                - addr - The address to read from.
            
            mem:ReadULonglong(addr) - Reads an unsigned long long.
                - addr - The address to read from.
            
            mem:ReadLonglong(addr) - Reads a signed long long.
                - addr - The address to read from.
            
            mem:ReadFloat(addr) - Reads a float.
                - addr - The address to read from.
            
            mem:ReadDouble(addr) - Reads a double.
                - addr - The address to read from.
            
            mem:ReadArray(addr, size) - Reads an array.
                - addr - The address to read from.
            
            mem:ReadString(addr, size) - Reads a string.
                - addr - The address to read from.
                - size - The size of the string to read.
            
            mem:WriteUChar(addr, val) - Writes an unsigned char.
                - addr - The address to write to.
                - val - The value to write.
            
            mem:WriteChar(addr, val) - Writes a signed char.
                - addr - The address to write to.
                - val - The value to write.
            
            mem:WriteUShort(addr, val) - Writes an unsigned short.
                - addr - The address to write to.
                - val - The value to write.
            
            mem:WriteShort(addr, val) - Writes a signed short.
                - addr - The address to write to.
                - val - The value to write.
            
            mem:WriteULong(addr, val) - Writes an unsigned long.
                - addr - The address to write to.
                - val - The value to write.
            
            mem:WriteLong(addr, val) - Writes a signed long.
                - addr - The address to write to.
                - val - The value to write.
            
            mem:WriteULonglong(addr, val) - Writes an unsigned long long.
                - addr - The address to write to.
                - val - The value to write.
            
            mem:WriteLonglong(addr, val) - Writes a signed long long.
                - addr - The address to write to.
                - val - The value to write.
            
            mem:WriteFloat(addr, val) - Writes a float.
                - addr - The address to write to.
                - val - The value to write.
            
            mem:WriteDouble(addr, val) - Writes a double.
                - addr - The address to write to.
                - val - The value to write.
            
            mem:WriteArray(addr, val) - Writes an array.
                - addr - The address to write to.
                - val - The value to write.
            
            mem:WriteString(addr, val) - Writes a string.
                - addr - The address to write to.
                - val - The value to write.
